package edu.spec.sms.model.lesson;

import edu.spec.sms.model.Course;
import edu.spec.sys.model.enumeration.Status;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by MadFrog on 2017/10/13.
 * 课堂, 对应每一节课
 */
@Entity
@Table(name = "t_lesson")
public class Lesson {

    private int id;              // 主键
    private Course course;
    private Date startTime;     // 课堂开始时间
    private String clazzIds;      // 班级主键拼接的字符串，用英文逗号分隔
    private String clazzNames;  // 班级名称拼接的字符串，用英文逗号分隔
    private String clazzRoom;
    private Status status;

    @Id
    @GeneratedValue
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @ManyToOne
    @JoinColumn(name = "course_id")
    public Course getCourse() {
        return course;
    }

    public void setCourse(Course course) {
        this.course = course;
    }

    @Column(name = "start_time")
    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    @Column(name = "clazz_Ids")
    public String getClazzIds() {
        return clazzIds;
    }

    public void setClazzIds(String clazzIds) {
        this.clazzIds = clazzIds;
    }

    @Column(name = "clazz_names")
    public String getClazzNames() {
        return clazzNames;
    }

    public void setClazzNames(String clazzNames) {
        this.clazzNames = clazzNames;
    }

    @Column(name = "clazz_room")
    public String getClazzRoom() {
        return clazzRoom;
    }

    public void setClazzRoom(String clazzRoom) {
        this.clazzRoom = clazzRoom;
    }

    public Status getStatus() {
        return status;
    }

    public void setStatus(Status status) {
        this.status = status;
    }

    public Lesson() {
    }
}
